#include <stdio.h>
#include <memory.h>
#include <string.h>
#include <iostream>

class Data
{
public:
	Data()
	{
		std::cout << "Data Create1" << std::endl;
	}

	Data(int d)
	{
		m_data = d;
		std::cout << "Data Create2" << std::endl;
	}

	~Data()
	{
		std::cout << "Data Destroy" << std::endl;
	}

	void setValue(int d) {
		m_data = d;
	}

	void printData()
	{
		std::cout << "data = " << m_data << std::endl;
	}
private:
	int m_data;
};

int main()
{
	Data *d = new Data(200);
	d->printData();
	(*d).printData();
	delete d;

	/*
	Data *d = new Data[20];
	for (int i = 0; i < 20; i++) {
		d[i].setValue(i*i);
	}

	for (int i = 0; i < 20; i++) {
		d[i].printData();
	}
	delete[] d;
	*/
	return 0;
}
